﻿using ChongJu.ModelManager.MQTT;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChongJu.EventManager
{
    public class CommonEvent
    {
        /// <summary>
        /// 设置主页面透明度
        /// </summary>
        public static event Action<bool> MainFromOpacityEventReport;
        public static void OnMianFromOpacity(bool value)
        {
            MainFromOpacityEventReport?.Invoke(value);
        }

        /// <summary>
        /// 运行日志
        /// </summary>
        public static event Action<string> RunLoggerEventReport;
        public static void OnRunLogger(string log)
        {
            RunLoggerEventReport?.Invoke(log);
        }

        /// <summary>
        /// 称重日志
        /// </summary>
        public static event Action<string> WeightLoggerEventReport;
        public static void OnWeightLogger(string log)
        {
            WeightLoggerEventReport?.Invoke(log);
        }

        /// <summary>
        /// 拍照时间
        /// </summary>
        public static event Action CameraEventReport;
        public static void OnCamera()
        {
            CameraEventReport?.Invoke();
        }

        /// <summary>
        /// 加载广告
        /// </summary>
        public static event Action LoadAdvertisingEventReport;
        public static void OnLoadAdvertising()
        {
            LoadAdvertisingEventReport?.Invoke();
        }


        /// <summary>
        /// 模型名称改变
        /// </summary>
        public static event Action<string> ModelNameExchangeEventReport;
        public static void OnModelNameExchange(string modName)
        {
            ModelNameExchangeEventReport?.Invoke(modName);
        }

        /// <summary>
        /// MQTT 通用系统指令
        /// </summary>
        public static event Action<MqttCommandModel> SystemCommandEventReport;
        public static void OnSystemCommand(MqttCommandModel command)
        {
            SystemCommandEventReport?.Invoke(command);
        }

        /// <summary>
        /// 退出系统
        /// </summary>
        public static event Action ExitSystemEventReport;
        public static void OnExitSystem()
        {
            ExitSystemEventReport?.Invoke();
        }
    }
}
